package cn.kgc.entity;

import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.*;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * sku信息(PmsSkuInfo)表实体类
 *
 * @author 石浩杰
 * @since 2022-12-05 09:38:30
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "pms_sku_info")
@SuppressWarnings("serial")
@JsonInclude(value = JsonInclude.Include.NON_NULL)
public class PmsSkuInfo extends Model<PmsSkuInfo> implements Serializable {

    //主键
    @TableId(type = IdType.AUTO)
    private Long id;


    /**
     * spuId
     **/
    @TableField(value = "spu_id")
    private Long spuId;


    /**
     * sku名称
     **/
    @TableField(value = "sku_name")
    private String skuName;


    /**
     * sku介绍描述
     **/
    @TableField(value = "sku_desc")
    private String skuDesc;


    /**
     * 所属分类id
     **/
    @TableField(value = "catalog_id")
    private Long catalogId;


    /**
     * 品牌id
     **/
    @TableField(value = "brand_id")
    private Long brandId;


    /**
     * 默认图片
     **/
    @TableField(value = "sku_default_img")
    private String skuDefaultImg;


    /**
     * 标题
     **/
    @TableField(value = "sku_title")
    private String skuTitle;


    /**
     * 副标题
     **/
    @TableField(value = "sku_subtitle")
    private String skuSubtitle;


    /**
     * 价格
     **/
    @TableField(value = "price")
    private BigDecimal price;


    /**
     * 销量
     **/
    @TableField(value = "sale_count")
    private Long saleCount;

    /**
     * 商品名字
     */
    @TableField(exist = false)
    private String spuName;


    /**
     * 品牌名字
     */
    @TableField(exist = false)
    private String brandName;


    /**
     * 分类名字
     */
    @TableField(exist = false)
    private String categoryName;


    //逻辑删除标志
    @TableLogic
    @JsonIgnore
    @TableField(fill = FieldFill.INSERT)
    private int deleted;


    //创建时间
    @TableField(value = "creationdate", fill = FieldFill.INSERT)
    @JsonIgnore
    private Date creationdate;


    //修改时间
    @TableField(value = "modifydate", fill = FieldFill.UPDATE)
    @JsonIgnore
    private Date modifydate;


    //版本
    @Version
    private int version;


}
